home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / allfiles / Itch / loading.dcr / 00005_Ball Parent.ls < prev    next >
Encoding:
Text File  |  1999-03-07  |  539 b   |  32 lines

  1. property sp, pos, spJump
  2.  
  3. on new me, asp
  4.   me.sp = asp
  5.   me.pos = the loc of sprite me.sp
  6.   spJump = -2
  7.   InitBall(me)
  8.   return me
  9. end
  10.  
  11. on InitBall me
  12.   me.pos = point(250, 120)
  13.   UpdatePos(me, point(0, 0))
  14.   set the blend of sprite the sp of me to random(10) * 5
  15. end
  16.  
  17. on MoveBall me
  18.   x = (random(7) - 4) * spJump
  19.   y = (random(7) - 4) * spJump
  20.   UpdatePos(me, point(x, y))
  21. end
  22.  
  23. on UpdatePos me, aPos
  24.   tempPos = me.pos + aPos
  25.   me.pos = tempPos
  26.   DrawtoStage(me)
  27. end
  28.  
  29. on DrawtoStage me
  30.   set the loc of sprite the sp of me to me.pos
  31. end
  32.